package org.KeyCrafter.cmd;

import org.KeyCrafter.key.*;

public class CmdProcRefs {
    private static final GenericKey genericKey = new GenericKey();
    private static final DBCommand dbCmd = genericKey;
    private static final StringCommand stringCmd = new StringKey();
    public static final HashCommand hashCmd = new HashKey();
    private static final ListCommand listCmd = new ListKey();
    private static final SetCommand setCmd = new SetKey();
    private static final ZSetCommand zsetCmd = new ZSetKey();
    private static final ServerCommand serverCommand = genericKey;



    // zset
    public static final CommandProc CMD_PROC_ZADD = zsetCmd::zaddCommand;
    public static final CommandProc CMD_PROC_ZINCRBY = zsetCmd::zincrbyCommand;
    public static final CommandProc CMD_PROC_ZRANGE = zsetCmd::zrangeCommand;
    public static final CommandProc CMD_PROC_ZREVRANGE = zsetCmd::zrevrangeCommand;
    // set
    public static final CommandProc CMD_PROC_SADD = setCmd::saddCommand;
    public static final CommandProc CMD_PROC_SINTER = setCmd::sinterCommand;// 返回集合交集
    public static final CommandProc CMD_PROC_SMEMBERS = setCmd::smembersCommand;// 指定集合所有元素
    public static final CommandProc CMD_PROC_SINTERSTORE = setCmd::sinterstoreCommand;
    // list
    public static final CommandProc CMD_PROC_RPUSH = listCmd::rpushCommand;
    public static final CommandProc CMD_PROC_LPUSH = listCmd::lpushCommand;
    public static final CommandProc CMD_PROC_LPOP = listCmd::lpopCommand;
    public static final CommandProc CMD_PROC_LLEN = listCmd::llenCommand;
    public static final CommandProc CMD_PROC_LRANGE = listCmd::lrangeCommand;
    // hash
    public static final CommandProc CMD_PROC_HMSET = hashCmd::hmsetCommand;
    public static final CommandProc CMD_PROC_HMGET = hashCmd::hmgetCommand;
    public static final CommandProc CMD_PROC_HSET = hashCmd::hsetCommand;
    public static final CommandProc CMD_PROC_HGET = hashCmd::hgetCommand;
    //String
    public static final CommandProc CMD_PROC_SET = stringCmd::setCommand;
    public static final CommandProc CMD_PROC_GET = stringCmd::getCommand;
    // db
    public static final CommandProc CMD_PROC_DEL = dbCmd::delCommand;
    public static final CommandProc CMD_PROC_SELECT = dbCmd::selectCommand;
    // aof
    public static final CommandProc CMD_PROC_BGREWRITEAOF = serverCommand::bgrewriteaofCommand;

    private CmdProcRefs(){}
}
